package simpleSort;

public class ArrTools {

    public static void swap(int[] arr, int i ,int j){
        int tmp = arr[j];
        arr[j] = arr[i];
        arr[i] = tmp;
    }
    public static <E> void swap(E[] arr, int i ,int j){
        E tmp = arr[j];
        arr[j] = arr[i];
        arr[i] = tmp;
    }

    public static <E> String printArr(E[] arr){
        if (arr == null || arr.length < 1){
            return "[] or null";
        }
        String head = "[";
        for (int i = 0; i <arr.length; i++) {
            head += arr[i];
            if (i != arr.length-1){
                head += ",";
            }
        }
        head += "]";
        return head;
    }

}
